<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/css/layui.css}">
    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <title>超市订单后台管理系统</title>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div th:replace="common::header"></div>
    <div th:replace="common::middle"></div>
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <div class="table-responsive">
                <div>
                    <form th:action="@{/Equipment/getEquipmentListByCondition/0}" method="post">
                        设备名称<input type="text" name="name">
                        运行状态<input type="text" name="state">&nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="submit" > 查询设备</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a th:href="@{/Equipment/showAddEquipment}" class="btn btn-primary btn-sm">添加设备</a>
                    </form>
                </div>
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>设备名</th>
                        <th>是否运行</th>
                        <th>工单数量</th>
                        <th>车间编号</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="equipment:${page.dataList}">
                        <td th:text="${equipment.getId()}"></td>
                        <td th:text="${equipment.getName()}"></td>
                        <td th:text="${equipment.getState()}"></td>
                        <td th:text="${equipment.getWorkOrder_num()}"></td>
                        <td th:text="${equipment.getWorkshop_id()}"></td>
                        <td>
                            <a th:href="@{/Equipment/getWorkOrderListById/0/}+${equipment.getId()}" class="btn btn-primary btn-sm">工单列表</a>
                            <a th:href="@{/Equipment/deleteById/}+${equipment.getId()}" class="btn btn-sm btn-danger deleteBtn">删除</a>
                            <a th:href="@{/Equipment/showUpdateEquipment/}+${equipment.getId()}" class="btn btn-primary btn-sm">修改</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <span th:text="'共有'+${page.totalPage}+'页  当前为第'+${page.currentPage}+'页  '"></span>
        <a th:href="@{/Workshop/getEquipmentList/}+${page.currentPage-1}" th:text="上一页 " th:if="${page.currentPage!=1}"></a>
        <a th:href="@{/Workshop/getEquipmentList/}+${page.currentPage+1}" th:text="下一页" th:if="${page.totalPage!=page.currentPage}"></a>
    </div>

    <div >

    </div>
</div>

</body>
<script th:src="@{/js/layui.js}"></script>
<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
            }
        });

    });
</script>
</html>
